<?php
$params = array_merge(
    require(__DIR__ . '/../../common/config/params.php'),
    require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php'),
    require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-backend',
    'basePath' => dirname(__DIR__),
    'controllerNamespace' => 'backend\controllers',
    'bootstrap' => ['log'],
    'timeZone'=>'Asia/Shanghai',        //指定默认的时区
    'modules' => [],
    'defaultRoute' => 'main/login',    //指定默认路由
    'components' => [
    
	    'db'=>[
			    'class'=>'yii\db\connection',
			    'dsn'=>'mysql:host=10.2.27.79;dbname=demo4',
	    		'username'=>'demo4',
				'password'=>'123'
    	],
    	
    	'authManager' => [
    		'class' => 'yii\rbac\DbManager',
    	],
    		
    	'request' => [

	    	'csrfParam' => '_backendCSRF',
	    	'csrfCookie' => [
	    	'httpOnly' => true,
	    	'path' => '/admin',
    		],

	    	'csrfParam' => '_backendCSRF',
		    	'csrfCookie' => [
			    	'httpOnly' => true,
			    	'path' => 'www/admin',
	    	],

    	],
    	
        'user' => [
            'identityClass' => 'backend\models\TauOperinfo',
            'enableAutoLogin' => true,
            'identityCookie' => [
	            'name' => '_backendIdentity',
	            'path' => 'www/admin',
	            'httpOnly' => true,
            ],
        ],
               
        'session' => [
        'name' => 'BACKENDSESSID',
	        'cookieParams' => [
	        'path' => 'www/admin',
       		 ],
        ],
        
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
            	[
                    'class' => 'yii\log\DbTarget',
                    'levels' => ['info'],
                    'categories' => ['options'],
                    'db'=>'db',
                    'logTable'=>'tba_loginfo',
                ],
                
                /* [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ], */
            ],
        ],
        
        'errorHandler' => [
            'errorAction' => 'main/error',
        ],
    ],
    'params' => $params,
];
